home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
lang
/
SmallEiffel.lha
/
SmallEiffel
/
lib_show
/
directory
/
example018.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-22
|
3KB
|
84 lines
/*
-- ANSI C code generated by :
-- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.79Beta#5)--
-- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
-- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr --
-- http://www.loria.fr/SmallEiffel --
*/
#include "example01.h"
/*
-- This file is free software, which comes along with SmallEiffel. This
-- software is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE. You can modify it as you want, provided
-- this header is kept unaltered, and a notification of the changes is added.
-- You are allowed to redistribute it and sell it, alone or as a part of
-- another product.
-- Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
-- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr
-- http://www.loria.fr/SmallEiffel
--
*/
/*
Stack and Registers traversal for PC Linux.
Addresses decrease as the stack grows.
Registers are saved using SETJMP().
*/
void mark_stack_and_registers(void) {
void** max = stack_bottom;
void** stack_pointer;
JMP_BUF registers;
(void)SETJMP(registers);
stack_pointer=((void**)(®isters));
while(stack_pointer < max) {
gc_mark(*(stack_pointer++));
}
}
void gc_start(void){
if(gc_is_off)return;
if(garbage_delayed())return;
gcmt_tail_addr=(((char*)(gcmt[gcmt_used-1]))+(gcmt[gcmt_used-1])->size);
((gc701*)eiffel_root_object)->header.flag=FSOH_UNMARKED;
gc_free571=NULL;
if(na_env1939.store_left>0){
na_env1939.store->header.size=na_env1939.store_left;
na_env1939.store->header.magic_flag=RSOH_FREE;
na_env1939.store_left=0;
}
na_env1939.chunk_list=NULL;
na_env1939.store_chunk=NULL;
if(na_env2135.store_left>0){
na_env2135.store->header.size=na_env2135.store_left;
na_env2135.store->header.magic_flag=RSOH_FREE;
na_env2135.store_left=0;
}
na_env2135.chunk_list=NULL;
na_env2135.store_chunk=NULL;
gc_free474=NULL;
gc_free1405=NULL;
gc_free701=NULL;
gc_free1707=NULL;
gc_free1886=NULL;
if(na_env9.store_left>0){
na_env9.store->header.size=na_env9.store_left;
na_env9.store->header.magic_flag=RSOH_FREE;
na_env9.store_left=0;
}
na_env9.chunk_list=NULL;
na_env9.store_chunk=NULL;
gc_free7=NULL;
gc_free2074=NULL;
gc_free528=NULL;
gc_mark701(eiffel_root_object);
manifest_string_mark1();
once_function_mark();
mark_stack_and_registers();
gc_sweep();
gc_start_count++;
}